﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Dapper;
using Elight.Entity;
using Elight.Repository.Interfaces;

namespace Elight.Repository
{
    public partial class UserRepository : BaseRepository<Sys_User>, IUserRepository
    {
        public Sys_User GetByUserName(string userName)
        {
            using (IDbConnection conn = OpenSharedConnection())
            {
                string sql = @"SELECT * FROM SYS_USER t WHERE t.UserName = @UserName";
                return conn.QueryFirst<Sys_User>(sql, new { UserName = userName });
            }
        }
    }
}
